home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / shazam11.zip / TESTCASE.PAS < prev    next >
Pascal/Delphi Source File  |  1990-12-05  |  1KB  |  68 lines

  1. {$X+}
  2. program TestCase;
  3.  
  4. uses Dos, Memory, Objects, Drivers, Views, Menus, Dialogs, App, StdDlg;
  5.  
  6. Const
  7.   cmTry = 150;
  8.   cmButton = 151;
  9.  
  10. type
  11.   TListboxRec = record
  12.     PS : PStringCollection;
  13.     Focused : Integer;
  14.     end;
  15. type
  16.   TMyApp = object(TApplication)
  17.     constructor Init;
  18.     procedure InitStatusLine; virtual;
  19.     procedure HandleEvent(var Event: TEvent); virtual;
  20.     end;
  21.  
  22. var
  23.   MyApp: TMyApp;
  24.   Dialog : PDialog;
  25.  
  26. constructor TMyApp.Init;
  27. var
  28.   R : Trect;
  29. begin
  30. TApplication.Init;
  31. end;
  32.  
  33. procedure TMyApp.InitStatusLine;
  34. var R: TRect;
  35. begin
  36.   GetExtent(R);
  37.   R.A.Y := R.B.Y - 1;
  38.   StatusLine := New(PStatusLine, Init(R,
  39.     NewStatusDef(0, $FFFF,
  40.       NewStatusKey('~Alt-X~ Exit', kbAltX, cmQuit,
  41.       NewStatusKey('~F9~ Try dialog', kbF9, cmTry,
  42.       nil)),
  43.     nil)
  44.   ));
  45. end;
  46.  
  47. (*----Insert MakeDialog here----*)
  48.  
  49. procedure TMyApp.HandleEvent(var Event: TEvent);
  50. begin
  51. TApplication.HandleEvent(Event);
  52.  
  53. if (Event.What = evCommand) and (Event.Command = cmTry) then
  54.   begin
  55.   Dialog := MakeDialog;
  56.   DeskTop^.ExecView(Dialog);
  57.   Dispose(Dialog, Done);
  58.   ClearEvent(Event);
  59.   end;
  60. end;
  61.  
  62. begin
  63.   MyApp.Init;
  64.   MyApp.Run;
  65.   MyApp.Done;
  66. end.
  67.  
  68.